//
//  ForgetPasswordView.m
//  JunZeWristband
//
//  Created by Kendama on 2017/8/16.
//  Copyright © 2017年 DT. All rights reserved.
//

#import "ForgetPasswordView.h"
#import "PhoneTextFieldView.h"
#import "VerifyTextFieldView.h"
#import "PasswordTextFieldView.h"

@implementation ForgetPasswordView

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        [self masLayoutSubview];
        
    }
    return self;
}

- (PhoneTextFieldView *)phoneView
{
    if(!_phoneView)
    {
        UIView *superView = self;
        _phoneView = [[PhoneTextFieldView alloc]init];
        _phoneView.phoneTextField.placeholder = @"请输入手机号码";
        [_phoneView.phoneTextField setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
        _phoneView.phoneTextField.keyboardType = UIKeyboardTypePhonePad;
        [superView addSubview:_phoneView];
    }
    return _phoneView;
}
- (VerifyTextFieldView *)verifyView
{
    if(!_verifyView)
    {
        UIView *superView = self;
        _verifyView = [[VerifyTextFieldView alloc]init];
        _verifyView.verifyTextField.placeholder = @"请输入验证码";
        [_verifyView.verifyTextField setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
        _verifyView.verifyTextField.keyboardType = UIKeyboardTypePhonePad;
        [superView addSubview:_verifyView];
    }
    return _verifyView;
}
- (PasswordTextFieldView *)passwordView
{
    if(!_passwordView)
    {
        UIView *superView = self;
        _passwordView = [[PasswordTextFieldView alloc]init];
        //        _passwordView.iconImageView.image = [UIImage imageNamed:@"icon_code"];
        _passwordView.iconImageView.hidden = YES;
        _passwordView.passwordTextField.placeholder = @"请输入密码";
        [_passwordView.passwordTextField setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
        [superView addSubview:_passwordView];
    }
    return _passwordView;
}

- (UIButton *)registerButton
{
    if(!_registerButton)
    {
        UIView *superView = self;
        _registerButton = [[UIButton alloc]init];
        [superView addSubview:_registerButton];
        [_registerButton setTitle:@"提交" forState:UIControlStateNormal];
        [_registerButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_registerButton.titleLabel setFont:fontCommonSize];
        [_registerButton setBackgroundColor:rgba(0,159,236,1)];
        _registerButton.layer.cornerRadius = 5;
    }
    return _registerButton;
}


- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    [self.phoneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top).with.offset(px1920Height(289));
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(90));
        make.right.mas_equalTo(superView.mas_right).with.offset(px1080Width(-90));
        make.height.mas_equalTo(px1920Height(152));
    }];
    
    [self.verifyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.phoneView.mas_bottom).with.offset(px1920Height(41));
        make.left.right.mas_equalTo(self.phoneView);
        make.height.mas_equalTo(px1920Height(152));
    }];
    
    [self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.verifyView.mas_bottom).with.offset(px1920Height(41));
        make.left.right.mas_equalTo(self.phoneView);
        make.height.mas_equalTo(px1920Height(152));
    }];
    
    
    [self.registerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.passwordView.mas_bottom).with.offset(px1920Height(132));
        make.left.right.mas_equalTo(self.phoneView);
        make.height.mas_equalTo(px1920Height(136));
    }];
    
}

@end
